package lanqiao;

import java.util.Scanner;

public class test2_3 {
    //203
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        String str1 = scan.next();
        String str2 = scan.next();
        if(str1.length()!=str2.length()){
            System.out.println("NO");
            System.exit(0);
        }

        char[] chars1 = str1.toCharArray();
        char[] chars2 = str2.toCharArray();

        int sum1=0;
        int sum2=0;
        for (int i = 0; i < chars1.length; i++) {
            sum1+=chars1[i]-'a';
            sum2+=chars2[i]-'a';
        }
        if(sum1==sum2){
            System.out.println("YES");
        }else{
            System.out.println("NO");

        }
    }
}
